package com.luozy.search.config;

import com.luozy.search.interceptor.SearchInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//注册自定义拦截器
@Configuration
public class SearchWebConfig implements WebMvcConfigurer {
    @Autowired
    private SearchInterceptor searchInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(searchInterceptor).addPathPatterns("/**");
    }
}
